#ifndef __FIFO_H
#define __FIFO_H

#if defined(__cplusplus)
extern "C" {
#endif

#include <stdint.h>

typedef struct
{
    uint32_t in;
    uint32_t out;
    uint32_t size;
    void *buffer;
} __S_FIFO;


int         fifoInit(__S_FIFO *fifo,void *bufferAddr,uint32_t size);
int         fifoClear(__S_FIFO *fifo);
uint32_t    fifoWrite(__S_FIFO *fifo,const void *buffer,uint32_t size);
uint32_t    fifoRead(__S_FIFO *fifo,void *buffer,uint32_t size);
uint32_t    fifoGetReadableSpaceSize(__S_FIFO *fifo);
uint32_t    fifoGetWriteableSpaceSize(__S_FIFO *fifo);


#if defined(__cplusplus)
}
#endif

#endif
